﻿using HuaweiCloud.Dotnet.Samples.ESports.Main.Dtos;
using HuaweiCloud.Dotnet.Samples.ESports.Main.Service;
using Microsoft.AspNetCore.Mvc;


namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Controllers
{
    [Route("api-main/v1/[controller]")]
    [Route("api/v1/[controller]")]
    [ApiController]
    public class PointsController : ControllerBase
    {
        private readonly IPointsService _service;
        public PointsController(IPointsService service)
        {
            _service = service;
        }
        [HttpGet("{userId}")]
        public async Task<ActionResult<PointsDto>> Get(Guid userId)
        {
            return Ok(await _service.GetScoresByUserIdAsync(userId));
        }
    }
}
